<!-- Home menu -->
<ul class="profilecontent_tab">
    <?php foreach($home_links as $key => $link) : ?>
    <li>
        <a <?php if ($link['active']) : ?>class="active"<?php endif;?> href="<?php echo URL::base_url() . $key ;?>"><?php echo $link['value'];?></a>
    </li>
    <?php endforeach;?>
</ul>
<div class="clear"></div>

<!-- thumbnails wrapper-->
<div class="photo_thumbnails_wrapper">
    <h2 class="search_title">
        <?php
            if(isset ($query))
                echo "Searching for '$query' in $searchtype";
            else
                echo "Displaying all $searchtype"
        ?>
    </h2>
    <h4><?php echo "Showing $startIdx to $endIdx out of $totalRes" ?></h4>
    <?php
        foreach($models as $model) {
            $thumb = View::factory($thumbfactoryname);
            $thumb->photo = $model;
            $thumb->user = $model;
            echo $thumb;
        }
    ?>

    <!-- Prev Next -->
    <div class="prev_next">
        <?php if($page > 0) { ?>
        <div class="prevbutton">
            <a href="<?php echo URL::base_url() . 'search' . '/' . $searchtype . '/' . ($page-1) . '/' . $query ?>">
                <img src="<?php echo URL::base_url() . '/public/image/left.png' ?>" alt="Prev"/>
            </a>
        </div>
        <?php } ?>
        <?php if($endIdx < $totalRes) { ?>
        <div class="nextbutton">
            <a href="<?php echo URL::base_url() . 'search' . '/' . $searchtype . '/' . ($page+1) . '/' . $query ?>">
                <img src="<?php echo URL::base_url() . '/public/image/right.png' ?>" alt="Prev"/>
            </a>
        </div>
        <?php } ?>
    </div>
</div>